<html>
<head><meta charset="utf-8"><title>how to set where rust looks for target std · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html">how to set where rust looks for target std</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="219742632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20set%20where%20rust%20looks%20for%20target%20std/near/219742632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html#219742632">(Dec 13 2020 at 03:59)</a>:</h4>
<p>If i do <code>env RUSTC=/path/to/my/local/stage1/bin/rustc cargo build --target wasm32-wasi</code> i get an error that the wasm32-wasi std is missing. I did configure rustc to build with that target, and it did build successfully, so i assume i just need to set some other variable to tell it where to look?</p>



<a name="219742875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20set%20where%20rust%20looks%20for%20target%20std/near/219742875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html#219742875">(Dec 13 2020 at 04:07)</a>:</h4>
<p>found out you're supposed to use <code>rustup toolchain link</code>, which is a much nicer way to have this available, but it still doesn't find the target std</p>



<a name="219744332"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20set%20where%20rust%20looks%20for%20target%20std/near/219744332" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html#219744332">(Dec 13 2020 at 04:58)</a>:</h4>
<p>How did you build the wasm standard library?</p>



<a name="219744338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20set%20where%20rust%20looks%20for%20target%20std/near/219744338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html#219744338">(Dec 13 2020 at 04:58)</a>:</h4>
<p>I think to cross compile you might need a stage 2 compiler? Not sure, I've only done this with -Z build-std</p>



<a name="219746046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/how%20to%20set%20where%20rust%20looks%20for%20target%20std/near/219746046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> devsnek <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/how.20to.20set.20where.20rust.20looks.20for.20target.20std.html#219746046">(Dec 13 2020 at 05:51)</a>:</h4>
<p>i eventually figured it out, i had put <code>wasm32-unknown-unknown</code> in the config.toml instead of <code>wasm32-wasi</code></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>